chore(commands): remove 32 deprecated aliases (closes #199)#202
Open
Wolfvin wants to merge 1 commit into
Open
Conversation
Issue #199: remove the 32 deprecated CLI aliases retained for one version after PR #195's 78→12 consolidation. The aliases (affected, arch-metrics, architecture, binary-scan, circular, complexity, dashboard, dataflow, dead-code, dependents, diff, env-check, git-status, graph-schema, import-snapshot, init, lsp-status, orient, outline, ownership, perf-hint, query-graph, regex-audit, secrets, semantic-query, side-effect, smell, staleness, symbols, taint, trace, vuln-scan) were hidden wrappers that printed a deprecation warning then redirected to the new umbrella command. Changes: - Removed register_command() calls from 30 alias modules in scripts/commands/. The modules themselves are kept because the 12 umbrella commands import them via importlib for their --check sub-analyses (e.g. audit.py imports commands.dead_code, security.py imports commands.secrets). - Deleted 2 alias modules that no umbrella imports: symbols.py, semantic_query.py (semantic search is reached via 'search --mode semantic'). - Removed deprecated_alias_for parameter from register_command() and the deprecation-warning dispatch block in codelens.py. - Updated README deprecated aliases section. - Updated tests that exclusively tested deprecated-alias behavior. MCP server fix (scripts/mcp_server.py): - Added importlib fallback in _execute_command() so MCP tools that dispatch to the now-unregistered alias modules (codelens_architecture, codelens_secrets, codelens_symbols, etc.) keep working. The CLI alias is gone (argparse rejects with 'invalid choice'), but the MCP surface is preserved. --diff-base post-filter fix (scripts/codelens.py): - Extended the post-filter to handle umbrella commands. The old logic checked args.command against alias names; now it also recognizes the umbrella names (security, audit, impact, context, deps) and filters each sub-result in result['r'] individually, attaching the diff_scope summary at the top level. --deep hybrid analysis fix (scripts/codelens.py): - Extended --deep post-processing to handle 'audit --check <category>' by mapping the check name back to the alias name (smell, dead-code, complexity) and targeting the enhancement at the matching sub-result in result['r']. DoD verification: - codelens --command-count → 12 ✓ - codelens dead-code / secrets / symbols → 'invalid choice' ✓ - codelens --help shows only the 12 umbrella commands ✓ - README deprecated aliases section updated ✓ Test results (vs baseline at 7fa4096): - 0 new regressions introduced - 4 pre-existing failures fixed (test_cli argparse -f conflict on 'affected'; test_compact_format MCP graph_schema tool visibility) - 18 pre-existing failures unchanged (test_doctor, test_search_pagination, test_confidence, etc. — unrelated to #199) Findings (out of scope, flagged for BOS): - DoD #1 says 'delete all 32 .py files'. This is impossible without breaking the umbrella commands, which import these modules via importlib for their --check sub-analyses. The approach taken here (remove the registration, keep the module) achieves the user-facing DoD (#2, #3, #4, #5) while preserving the implementation.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
4 tasks
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Removes the 32 deprecated CLI aliases retained for one version after PR #195's 78→12 consolidation.
Aliases removed: affected, arch-metrics, architecture, binary-scan, circular, complexity, dashboard, dataflow, dead-code, dependents, diff, env-check, git-status, graph-schema, import-snapshot, init, lsp-status, orient, outline, ownership, perf-hint, query-graph, regex-audit, secrets, semantic-query, side-effect, smell, staleness, symbols, taint, trace, vuln-scan.
What changed
register_command()calls from 30 alias modules inscripts/commands/. The modules themselves are kept because the 12 umbrella commands import them viaimportlibfor their--checksub-analyses (e.g.audit.pyimportscommands.dead_code,security.pyimportscommands.secrets).symbols.py,semantic_query.py(semantic search is reached viasearch --mode semantic).deprecated_alias_forparameter fromregister_command()and the deprecation-warning dispatch block incodelens.py.Supporting fixes (required to keep umbrella + MCP surface working after alias removal)
MCP server dispatch fallback (
scripts/mcp_server.py)Added an
importlibfallback in_execute_command()so MCP tools that dispatch to the now-unregistered alias modules (codelens_architecture,codelens_secrets,codelens_symbols,codelens_trace, etc.) keep working. The CLI alias is gone (argparse rejects withinvalid choice), but the MCP surface is preserved.--diff-basepost-filter (scripts/codelens.py)Extended the post-filter to handle umbrella commands. The old logic checked
args.commandagainst alias names; now it also recognizes the umbrella names (security,audit,impact,context,deps) and filters each sub-result inresult['r']individually, attaching thediff_scopesummary at the top level.--deephybrid analysis (scripts/codelens.py)Extended
--deeppost-processing to handleaudit --check <category>by mapping the check name back to the alias name (smell,dead-code,complexity) and targeting the enhancement at the matching sub-result inresult['r'].Definition of Done verification
symbols.py,semantic_query.py); 30 files kept as implementation modules (umbrellas import them viaimportlib). See Findings below.codelens --helptidak menampilkan alias manapun — only the 12 umbrella commands appear.invalid choice(verified fordead-code,secrets,symbols).codelens --command-counttetap return 12.Test results
Baseline (at
7fa4096): 22 pre-existing failures (test_doctor, test_search_pagination, test_confidence, etc. — environment / pre-existing).This PR: 18 failures — 0 new regressions, 4 pre-existing failures fixed:
test_cli.py::TestArgparseFormatConflictRegression::test_affected_with_filter_short_does_not_crashtest_cli.py::TestArgparseFormatConflictRegression::test_no_duplicate_f_in_subparserstest_compact_format.py::TestMCPGraphSchemaTool::test_graph_schema_tool_presenttest_compact_format.py::TestMCPGraphSchemaTool::test_graph_schema_tool_has_workspace_paramPre-existing failures ignored per CONTEXT.md:
test_integration.py(worktree path arithmetic),test_lsp_server.py(lsprotocoloptional dep),test_large_file_parsing.py(tree-sitter segfault).Findings (out of scope, flagged for BOS)
DoD #1 says "delete all 32 .py files". This is impossible without breaking the 12 umbrella commands, which import these modules via
importlibfor their--checksub-analyses. For example,audit.pydoesimportlib.import_module('commands.dead_code')to run the dead-code sub-analysis. Deletingdead_code.pywould breakcodelens audit --check dead-code.The approach taken here (remove the registration, keep the module) achieves all user-facing DoD items (#2, #3, #4, #5) while preserving the implementation. The 2 modules that no umbrella imports (
symbols.py,semantic_query.py) were deleted entirely.Closes #199.